<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../org/jquery.min.js"></script>
    <script src="../org/angular.min.js"></script>
</head>
<body>

<div ng-app="hd">
    <div ng-controller="ctrl">
    <a href="" ng-click="get()">get</a><br/>
    {{message}}<hr>


    <a ng-click="getClientHeight()" href="">获取窗口大小</a><br/>
    窗口大小：{{clientHeight}}<hr>

    <a ng-click="getScrollHeight()" href="">获取窗口大小</a><br/>
    窗口大小：{{scrollHeight    }}
    </div>

</div>


<script>

    var m = angular.module('hd', []);
    m.controller('ctrl', ['$scope', '$window', function ($scope, $window) {
        $scope.name1 = '后盾人1';
        $scope.name2 = '后盾人2';
        $scope.message = '';

        $scope.get = function () {
            if($window.confirm('你确定操作吗？')){
                $scope.message = '你点了确定';
            }else{
                $scope.message = '你点了取消';
            }
        };

        $scope.getClientHeight = function () {
            $scope.clientHeight = $window.document.body.clientHeight;
        };

        $scope.getScrollHeight = function () {
            $scope.scrollHeight = $window.document.body.scrollHeight;
        };

    }]);

</script>

</body>
</html>

